import request from '/@/utils/request';

/**
 * 系统用户
 */
export function roleApi() {
	return {
		getList: (params?: object)=> {
			return request({
				url: import.meta.env.VITE_APP_BASE_API+'/system/role/list',
				method: 'post',
				params
			});
		},
		edit: (params?: object)=> {
			return request({
				url: import.meta.env.VITE_APP_BASE_API+'/system/role',
				method: 'put',
				data: params
			});
		},
		query: (id?: string)=> {
			return request({
				url: import.meta.env.VITE_APP_BASE_API+'/system/role/'+id,
				method: 'get'
			});
		},
		insert: (params?: object) => {
			return request({
				url: import.meta.env.VITE_APP_BASE_API+'/system/role',
				method: 'post',
				data: params
			});
		},
		delete: (id?: string) => {
			return request({
				url: import.meta.env.VITE_APP_BASE_API+'/system/role/' + id,
				method: 'delete'
			});
		},
		menuList: (params?: object)=> {
			return request({
				url: import.meta.env.VITE_APP_BASE_API+'/system/function/menuList',
				method: 'post',
				params
			});
		},
	};
}
